#include <xlcomm/net/detail/timer.h>

namespace xlcomm {
namespace net {

std::atomic<int64_t> Timer::num_created_(0);

void Timer::Reset(Timestamp now) {
  if (repeat_) {
    when_expire_ = DateTime::AddSeconds(now, interval_second_);
  } else {
    when_expire_ = DateTime::Invalid();
  }
}

}  // namespace net
}  // namespace xlcomm